/*
 * @Author: Turump 
 * @Date: 2021-04-25 20:00:44 
 * @Last Modified by: Turump
 * @Last Modified time: 2021-05-25 19:17:37
 */

import { TweenType } from "../../misc/TweenType";
import ActionBaseTask from "./ActionBaseTask";

const { ccclass, property, menu } = cc._decorator;

@ccclass
@menu("动作任务/ScaleTo")
export default class ScaleToTask extends ActionBaseTask {

    @property({ displayName: "重复任务", override: true, visible: false })
    repeatableTask = false;

    @property({ displayName: "ScaleTo参数" })
    scaleToParam: cc.Vec2 = cc.v2(1, 1);

    getAction() {
        return cc.tween(this.node)
            .then(this.getPlayAudioTween())
            .to(this.actionDuration,
                { scaleX: this.scaleToParam.x, scaleY: this.scaleToParam.y },
                { easing: Object.keys(TweenType)[this.easeType] })
    }
}
